package io.geekidea.boot.outboundBenhavior.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.geekidea.boot.framework.page.Paging;
import io.geekidea.boot.framework.service.impl.BaseServiceImpl;
import io.geekidea.boot.otherstores.query.total;
import io.geekidea.boot.outboundBenhavior.dto.OutboundBenhaviorDto;
import io.geekidea.boot.outboundBenhavior.entity.OutboundBehavior;
import io.geekidea.boot.outboundBenhavior.mapper.OutboundBenhaviorMapper;
import io.geekidea.boot.outboundBenhavior.query.OutboundBenhaviorQuery;
import io.geekidea.boot.outboundBenhavior.service.OutboundBenhaviorService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


/**
 * 业务逻辑层
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class OutboundBenhaviorServiceImpl extends BaseServiceImpl<OutboundBenhaviorMapper,OutboundBehavior> implements OutboundBenhaviorService {

    @Resource
    private OutboundBenhaviorMapper outboundBenhaviorMapper;


    /*列表分页*/
    @Override
    public List<OutboundBehavior> getOutBehList(OutboundBenhaviorQuery outboundBenhaviorQuery) {
        return outboundBenhaviorMapper.getOutBehList(outboundBenhaviorQuery);
    }

    @Override
    public total getTotal(OutboundBenhaviorQuery outboundBenhaviorQuery) {
        return outboundBenhaviorMapper.getTotal(outboundBenhaviorQuery);
    }

    /*详情*/
    @Override
    public OutboundBehavior getOutBhe(Integer id) {
        return outboundBenhaviorMapper.getOutBhe(id);
    }

    /*添加*/
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean addOutBeh(OutboundBenhaviorDto outboundBenhaviorDto) {
        return outboundBenhaviorMapper.addOutBeh(outboundBenhaviorDto) > 0;
    }

    /*修改*/
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateOutbeh(OutboundBehavior outboundBehavior) {
        return outboundBenhaviorMapper.updateOutbeh(outboundBehavior) > 0;
    }
}
